<template>
  <div id="app">
    <a href="javascript:void(0)" @click="home">返回目录</a>
    <router-view/>
  </div>
</template>

<script>
export default {
  name: 'app',
  data() {
    return {}
  },
  methods: {
    home() {
      if (this.$route.path === '/catalog') {
        alert('当前已经是目录页面了')
        return
      }
      this.$router.push({path: '/catalog'})
    }
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  margin-top: 10px;
}
</style>
